# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=py3-typeguard
_pkgname=typeguard
pkgver=4.1.5
pkgrel=1
pkgdesc="run-time type checker for Python "
url="https://typeguard.readthedocs.io/"
arch="noarch"
license="MIT"
depends="py3-bracex py3-typing-extensions" # TODO: remove py3-typing-extensions once python>3.12
makedepends="py3-gpep517 py3-setuptools_scm py3-wheel"
checkdepends="py3-mypy py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

build() {
	SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver \
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	rm -f tests/mypy/test_type_annotations.py # test is broken
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
50bf3760246dba5de2e98038c78acbd6f2fd2d69ae8c688c3efeface5ef6cc4c2521f82d6084dabc1258286ac589ff94f1b9e3c9b67e9b019d725bf13884fce2  typeguard-4.1.5.tar.gz
"
